import {listType} from "@/api/system/type";
import {error} from "echarts/types/src/util/log";

export  default  {
  state(){
    return {
      typeList:[]
    }
  },
  actions:{
    getTypeList({pageNum=1,
      pageSize= 10}){
      return new Promise((resolve, reject)=>{
        listType({pageNum,pageSize}).then(res =>{
          setList("SETLIST",res.rows)
          resolve
        }).catch(error=>{
          reject(error)
        })
      })
    }
  },
  mutations:{
    SETLIST :(state,data)=>{
      state.typeList = data
    }
  }
}
